
   <html>
   <head>
   <style type=text/css>
   body { font-size: 10pt; font-family: Arial; }
   </style>
   </head>
   <body>
   
</br>
<font color="darkred">#include</font>&lt;stdio.h&gt;</br>
<font color="darkred">#include</font>&lt;coelacanth/string.h&gt;</br>
</br>
void&nbsp;testfunc(void&nbsp;*v)</br>
{</br>
&nbsp;&nbsp;&nbsp;string_ptr(s);</br>
&nbsp;&nbsp;&nbsp;s&nbsp;=&nbsp;v;</br>
&nbsp;&nbsp;&nbsp;string_cut(s,&nbsp;5,&nbsp;17);</br>
}</br>
</br>
</br>
<font color="darkgreen">int</font>&nbsp;main()</br>
{</br>
&nbsp;&nbsp;&nbsp;string(str);</br>
</br>
&nbsp;&nbsp;&nbsp;string_assign_<font color="darkgreen">int</font>(str,&nbsp;23);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("%s=%d\n",&nbsp;str,&nbsp;string_to_<font color="darkgreen">int</font>(str));</br>
&nbsp;&nbsp;&nbsp;</br>
&nbsp;&nbsp;&nbsp;string_assign_<font color="darkgreen">float</font>(str,&nbsp;3.33);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("%s=%f\n",&nbsp;str,&nbsp;string_to_<font color="darkgreen">float</font>(str));</br>
</br>
&nbsp;&nbsp;&nbsp;string_assign_str(str,&nbsp;"\t\t&nbsp;&nbsp;&nbsp;Hello&nbsp;World!&nbsp;&nbsp;\t\n\r&nbsp;");</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("-%s-\n",&nbsp;str);</br>
</br>
&nbsp;&nbsp;&nbsp;string_trim(str);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("-%s-\n",&nbsp;str);</br>
</br>
</br>
&nbsp;&nbsp;&nbsp;string_replace(str,&nbsp;"Hello",&nbsp;"h3ll0");</br>
&nbsp;&nbsp;&nbsp;string_replace(str,&nbsp;"here",&nbsp;"h3r3");</br>
&nbsp;&nbsp;&nbsp;string_replace(str,&nbsp;"I",&nbsp;"1");</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("%s\n",&nbsp;str);</br>
</br>
&nbsp;&nbsp;&nbsp;string_lpad(str,&nbsp;'x',&nbsp;strlen(str)+5);</br>
&nbsp;&nbsp;&nbsp;string_rpad(str,&nbsp;'x',&nbsp;strlen(str)+3);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("%s\n",&nbsp;str);</br>
</br>
&nbsp;&nbsp;&nbsp;testfunc(str);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("%s\n",&nbsp;str);</br>
</br>
&nbsp;</br>
&nbsp;&nbsp;&nbsp;</br>
&nbsp;&nbsp;&nbsp;<font color="darkgreen">int</font>&nbsp;pos&nbsp;=&nbsp;0;</br>
&nbsp;&nbsp;&nbsp;if((pos=string_find(str,&nbsp;"World"))==-1)</br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("not&nbsp;found\n");</br>
&nbsp;&nbsp;&nbsp;else</br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("pattern&nbsp;in&nbsp;pos:&nbsp;%d\n",&nbsp;pos);</br>
</br>
</br>
&nbsp;&nbsp;&nbsp;string_free(str);</br>
</br>
&nbsp;&nbsp;&nbsp;<font color="#6d4d00">return</font>&nbsp;0;</br>
}</br>
</br>
</br>
</body></html>
